package com.cool.modules.finance.constant;

import lombok.Getter;

@Getter
public enum AccountType {

    NORMAL(1, "普通账户"),
    DEBIT(2, "借记账户"),
    FINANCE(3, "理财账户");

    private final Integer type;

    private final String desc;

    public static String getByType(Integer type) {
        for (AccountType accountType : AccountType.values()) {
            if (accountType.getType().equals(type)) {
                return accountType.getDesc();
            }
        }
        return null;
    }

    AccountType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

}
